package com.jiajian.cm.mapper;

import com.jiajian.cm.domain.SysRole;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface SysRoleMapper {
    //find all roles
    List<SysRole> findAllRoles();
    //find role by id
    SysRole findRoleById(Long id);
    //add role
    int addRole(SysRole sysRole);
    //更新角色
    int updateRole(SysRole sysRole);
    //按照当前角色ID删除角色部分信息
    int deleteRole(Long id);
    //给当前角色分配权限
    int addRight(Long roleId, Long resourceId);
    //删除当前角色的权限
    int deleteRight(Long roleId, Long resourceId);
    //查询指定角色的所有三级权限id
    List<Long> findAllRights(Long roleId);

}
